/**
 * Copyright (c) 2011 Roundarch (www.roundarch.com)
 *
 * Author Joshua Jung
 *
 * ---
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.roundarch.flex.controls.graphControlInterfaces
{
    import flash.geom.Point;
    
    import mx.core.IUIComponent;
    import mx.styles.IStyleClient;

    /**
     * An interface for each selection control inside a GraphControl.
     *
     * One important note is that a selector should not position itself. All positioning - and final confirmation
     * of value - should be done via the parent graph control.
     *
     * @author jjung
     */
    public interface IGraphControlSelector extends IUIComponent, IGraphControlChild, IStyleClient
    {
        //---------------------------------------------------------------------
        //
        //  Properties
        //
        //---------------------------------------------------------------------
        function get alwaysVisible () : Boolean;
        
        function get constraints() : Array;

        /**
         * All of the constraints associated with this graph control.
         *
         * Each constraint is expected to implement ISelectorConstraint.
         */
        function set constraints(value : Array) : void;

        /**
         * The horizontal interval that this selector aligns itself with.
         */
        function get hInterval() : IIntervalCollection;
        function set hInterval(value : IIntervalCollection) : void;

        /**
         * Tells this selector that one of the constraints has changed in some way.
         */
        function invalidateConstraints() : void;

        /**
         * Call this if you wish to have the value of this selector reevaluated given the constraints.
         *
         * You may optionally pass in a requested value. There is no guarantee the requested value
         * will be honored if it does not fall within the constraints.
         */
        function invalidateValue(requested : Point = null) : void;

        /**
         * If true, the graph control will place this selector behind the renderers, in stead of in front as
         * is the default.
         */
        function get placeBehindRenderers() : Boolean;

        function get scrollType() : String;

        /**
         * Called by the parent graph control to indicate the value associated with this selector
         * has changed.
         */
        function selectedPointChanged() : void;

        /**
         * The vertical interval that this selector aligns itself with.
         */
        function get vInterval() : IIntervalCollection;
        function set vInterval(value : IIntervalCollection) : void;

        /**
         * Should return the value of this point.
         *
         * Important note: return the value of the point via the parent graph control to ensure
         * consistency.
         */
        function get value() : Point;
        function set value(value : Point) : void;
        
        function get offsetY() : Number;
    }
}
